import request from "../utils/request.js";

export function getList(queryParams){
    return request({
        url: '/menu/list',
        method: 'get',
        params: queryParams
    })
}

export function getMenu(menuId) {
    return request({
        url: 'menu/' + menuId,
        method: 'get'
    })
}

export function getMenuTreeSelect(){
    return request({
        url: '/menu/treeselect',
        method: 'get',
    })
}



export function addMenu(menu){
    return request({
        url: '/menu',
        method: 'post',
        data: {
            ...menu
        }
    })
}

export function updateMenu(menu){
    return request({
        url: '/menu',
        method: 'put',
        data: {
            ...menu
        }
    })
}

export function deleteMenu(menuId){
    return request({
        url: '/menu/' + menuId,
        method: 'delete',
    })
}
export function getIcons(){
    return request({
        url: '/menu/icons',
        method: 'get',
    })
}

